package com.configclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: hejianding
 * @Date: 2021/3/19 9:35
 * @Version: 1.0
 */
@RestController
@RefreshScope
public class IndexController {

    // 配置远程 git 仓库中配置文件的 key，且设置个默认值
    @Value("${springcloud.book.config:123}")
    private String book;

    @RequestMapping("/getBookConfig")
    public String getBookConfig(){
        return book;
    }

}
